<!DOCTYPE html>
<%@page import="com.faeple.util.SessionManager"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ page language="java" contentType="text/html;  charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="java.net.InetAddress" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%
 java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy, MM, dd, HH, mm, ss");
 String time = formatter.format(new java.util.Date()); 
%> 

<html lang="ko">
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	
	<title>Faeple</title>
	
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
	<!--[if lt IE 9]>
		<script src="/resources/js/html5shiv.js"></script>
		<script src="/resources/js/respond.min.js"></script>
	<![endif]-->
	<link rel="stylesheet" href="/resources/css/font-awesome.css">
	<link rel="stylesheet" href="http://fonts.googleapis.com/earlyaccess/nanumgothic.css">
	<style type="text/css">
		body {
			color:#333;
		}
		.navbar-static-top {
			margin-bottom: 19px;
		}
		.cnt { font-size:28px;margin-top:6px;font-family: sans-serif; }
	</style>
</head>
<body>
<jsp:include page="menu.jsp" flush="false"> 
	<jsp:param name="todayHelpCnt" value="${todayHelpCnt}"/> 
</jsp:include> 

<div class="container">
	<div class="well">
		<h3>서버 정보</h3>
		<hr>
		<div>
			<p>■ 호스트 : <%= InetAddress.getLocalHost().getHostName() %></p>
			<p>■ 아이피 : <%= InetAddress.getLocalHost().getHostAddress() %></p>
			<p>■ 포트 : <%=request.getServerPort()%></p>
			<p>■ 서버이름 : <%=request.getServerName()%></p>
			<p>■ 현재 접속자 : <%=SessionManager.getCount()%>명</p>
			<p>■ 서버시간 : <span id="server_time"></span></p>
		</div>
	</div>
	<div class="well">
		<h3>오늘자 카운트</h3>
		<hr>
		<div class="row">
			<div class="col-md-2" style="text-align: center;"><p>가입자</p><span class="cnt">${todaySignMember}</span></div>
			<div class="col-md-2" style="text-align: center;"><p>로그인</p><span class="cnt">${todayLoginMember}</span></div>
			<div class="col-md-2" style="text-align: center;"><p>탈퇴</p><span class="cnt">${todayLeaveMember}</span></div>
			<div class="col-md-2" style="text-align: center;"><p>게시글</p><span class="cnt">${todayUploadPost}</span></div>
			<div class="col-md-2" style="text-align: center;"><p>코멘트</p><span class="cnt">${todayAddComment}</span></div>
			<div class="col-md-2" style="text-align: center;"><p>태그</p><span class="cnt">${todayAddTag}</span></div>
	<%-- 		<div class="col-md-2" style="text-align: center;"><p>고객지원</p><span class="cnt">${todayHelpCnt}</span></div> --%>
		</div>
	</div>
	<div class="well">
		<h3>전체 카운트</h3>
		<hr>
		<div class="row">
			<div class="col-md-2" style="text-align: center;"><p>멤버</p><span class="cnt">${totalMemberCnt}</span></div>
			<div class="col-md-2" style="text-align: center;"><p>게시글</p><span class="cnt">${totalPostCnt}</span></div>
			<div class="col-md-2" style="text-align: center;"><p>안드로이드</p><span class="cnt">${totalAndroidUser}</span></div>
		</div>
	</div>
</div>
</body>
<script src="/resources/js/jquery-1.11.0.js"></script>
<script src="/resources/js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(function(){
		$(".navbar-nav").children("li").eq(0).addClass("active");
	});
	
	var date = new Date(<%= time %>);
	document.getElementById("server_time").innerHTML = date;
	window.setInterval("getServerTime();",1000);
	
	function getServerTime(){
		date.setSeconds(date.getSeconds() + 1);
		document.getElementById("server_time").innerHTML = date;
	}
</script>
</html>